package bean;

import lombok.*;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

/**
 * @classname:Product
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/31 23:20
 * @version: 0.1
 * @since:1.8
 */
@NoArgsConstructor
@AllArgsConstructor
@Setter
@Getter
@ToString
public class Product {
    private Integer pid;
    private Integer parentId;
    private String typeName;
    private Integer is_parent;
    private Integer status;
    private Date create_time;
    private Date update_time;

    public Product(ResultSet rs) {
        try {
            this.pid = rs.getInt("pid");
            this.parentId = rs.getInt("parentId");
            this.typeName = rs.getString("typeName");
            this.is_parent = rs.getInt("is_parent");
            this.status = rs.getInt("status");
            this.create_time = (Date) rs.getObject("create_time");
            this.update_time = (Date) rs.getObject("update_time");
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
